package learn2;
//测试多态进行强制类型转换后的内容变化
public class test1 {
    public static void main(String[] args) {
        animal a = new animal(10,"小猫");
        a.eat();
        a.sleep();
        a.run();

        animal b = new cat(10,"小猫",5);
        b.eat();
        b.sleep();
        b.run();
        System.out.println(b.age);
        System.out.println(b.name);
        System.out.println(((cat)b).weight);
    }
}